{% extends "base_blank.volt" %}
{% block pageHeader %}
    {{ stylesheet_link("/libs/bootstrap-daterangepicker/daterangepicker.css", false) }}
{% endblock %}
{% block pageFooter%}
	{{ javascript_include("/libs/bootstrap-daterangepicker/moment.min.js", false) }}
    {{ javascript_include("/libs/bootstrap-daterangepicker/daterangepicker.js", false) }}
    {{ javascript_include("/js/area.js", false) }}
    {{ javascript_include("/assets/manage/js/bp/listComment.js", false) }}
{% endblock %}

{% block content %}
<div class="container-fluid" id="content_box_blank">
    <div class="row">
    <div class="col-xs-12">
        <ol class="breadcrumb">
            <li>美容院管理</li>
            <li class="active">美容院评论</li>
            <li class="active">列表</li>
        </ol>

	<div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" role="form" action="" method="get">
                	<input type="hidden" name="id" value="{{id}}">
                    <div class="form-group">
                        <div class="input-group">
                        	<label class="input-group-addon" for="">用户名</label>
                        	<input class="form-control" type="text" name="user_name" id="" value="{{user_name}}" />
                    	</div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                        	<label class="input-group-addon" for="">回复时间</label>
                        	<input class="form-control" type="text" id="comment_addtime" name="comment_addtime"  readonly="readonly" value="{{comment_addtime}}" style="width: 400px;" />
                    	</div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                    </div>
                </form>
            </div>
        </div>
	
    <table class="table table-hover">
        <thead>
        <tr>
            <th style="width: 60px;">ID</th>
            <th style="width: 120px;">用户</th>
            <th>评论内容</th>
            <th style="width: 60px;">状态</th>
            <th style="width: 180px;">时间</th>
            <th style="width: 200px;"></th>
        </tr>
        </thead>
        {% for d in commentList %}
            <tr>
                <td>{{ d['comment_id'] }}</td>
                <td>{{ d['user_nickname'] }}</td>
                <td>{{ d['comment_info']|e }}
                    <div class="comment_photos_box">
                    {% for pic in json_decode(d['comment_photos']) %}
                        <div class="pic_list">
                            <a href="{{ PicUrlBPPic(pic, this.getDi()) }}" class="thumbnail" target="_blank">
                                <img src="{{ PicUrlBPPic(pic, this.getDi()) }}@!120" alt="" />
                            </a>
                        </div>
                    {% endfor %}
                    </div>
                </td>
                <td>{{ GeneralStateValue2Str(d['comment_state']) }}</td>
                <td>{{ d['comment_addtime'] }}</td>
                <td>
                    <div class="dropdown">
                        <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d['comment_id'] }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d['comment_id'] }}">
                            {% if d['comment_state'] == 1 %}
                                <li><a href="javascript:void(0)" durl="{{ url.get('bpcomment/setState') }}" did="{{ d['comment_id'] }}" dstate="-1" class="bp_set_state"><i class="fa fa-trash-o fa-fw"></i> 删 除</a></li>
                            {% endif %}
                            {% if d['comment_state'] == -1 %}
                                <li><a href="javascript:void(0)" durl="{{ url.get('bpcomment/setState') }}" did="{{ d['comment_id'] }}" dstate="1" class="bp_set_state"><i class="fa fa-reply fa-fw"></i> 恢 复</a></li>
                            {% endif %}
                        </ul>
                    </div>
                </td>
            </tr>
        {% endfor %}
    </table>

    {{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('bpcomment/list', [
            'id': id,
            'user_name':user_name,
            'comment_addtime':comment_addtime,
            'page': '__PAGE__'
        ]
    )) }}

</div>
    </div>
</div>

{% endblock %}